home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 June / macformat-038.iso / Shareware City / Applications / DocBreaker 1.0 / DB sample script < prev    next >
Encoding:
Text File  |  1996-02-17  |  1.6 KB  |  52 lines  |  [TEXT/ToyS]

  1. (*
  2.  
  3. Sample script to show the DocBreaker's scripting features
  4. Before using this sample script, you need:
  5.  
  6. - AppleScript software installed
  7. - XTND software installed
  8. - the DocBreaker application installed
  9. - the "Examples" folder from the DocBreaker package in the same folder as DocBreaker
  10.  
  11. This example shows a Microsoft RTF -> Claris MacWrite Pro translation.
  12. If the required translators are not available, you will have to change the script.
  13.  
  14. *)
  15.  
  16. tell application "DocBreaker 1.0"
  17.     activate
  18.     try
  19.         with timeout of 600 seconds
  20.             
  21.             -- assign the general preferences
  22.             
  23.             set preference max files to 5
  24.             
  25.             set preference font rule to is_equal_to
  26.             set preference font to "Courier"
  27.             
  28.             set preference size rule to is_greater_than
  29.             set preference size to 14
  30.             
  31.             set preference style rule to is_equal_to
  32.             set preference style to plain -- this is needed to override existing preferences
  33.             set preference style to underline
  34.             set preference style to bold
  35.             
  36.             set preference justification rule to differs_from
  37.             set preference justification to center
  38.             
  39.             set preference color rule to is_equal_to
  40.             set preference color to red
  41.             
  42.             -- break the file "FileToBreak.rtf" and produces a file series called "Part.xxx"
  43.             -- asking to the MacWrite Pro 1.x translator to build MacWrite Pro files
  44.             
  45.             break the file ":Examples:FileToBreak.rtf" into file ":Examples:Part" using translator "MacWrite Pro 1.x" with format "MWPd"
  46.         end timeout
  47.     on error errText number errNum
  48.         beep
  49.         display dialog "An error occurred! " & errText & " Error code: " & errNum buttons {"Alas"} default button "Alas" with icon 0
  50.     end try
  51.     quit
  52. end tell